from pydantic import BaseModel, Field
from typing import List, Optional
from app.schemas.storage import OssConfig


class LabelPosition(BaseModel):
    x: float = 0
    y: float = 0
    width: Optional[float] = 0
    height: Optional[float] = 0


class MediaFileLabel(BaseModel):
    name: Optional[str] = ''
    create_staff_name: str
    image_width: float
    image_height: float
    type: str
    color: str
    position: LabelPosition


class PlotDefect(BaseModel):
    id: int
    file_url: str
    defect_label_list: List[MediaFileLabel]
    oss_config: OssConfig
    upload_callback_url: str
